<?php
final class AsynTask {
	private $task;
	private $args=array();

	public function __construct($task,$args=array()){
		$this->task=$task;
		$this->args=$args;
	}

  	public function execute() {
		$url='/trunk/chenyong/asyndeal.php?';
		$url.='route='.$this->task;
		foreach($this->args as $key => $value){
			$url.='&'.$key.'='.$value;
		}
		$fp=fsockopen('localhost',80,&$errno,&$errstr,5);
		if(!$fp){
			echo "$errstr ($errno)<br />\n";
		}
		//atention to end the str with \r\n
		fputs($fp,"GET ".$url."\r\n");
		fclose($fp);
  	}
}
?>